import instance from '@/utils/request'

// 创建校友
export function createAlumni(data) {
    return instance.request({
        method: 'post',
        url: '/api/alumni/create',
        data,
        headers: {
            'admintoken': localStorage.getItem('adminToken')
        }
    })
}

// 获取校友列表
export function getAlumnis(query) {
    return instance.request({
        method: 'get',
        url: '/api/alumni/list',
        params: query,
        headers: {
            'admintoken': localStorage.getItem('adminToken')
        }
    })
}

// 获取校友详情
export function getAlumniDetail(id) {
    return instance.request({
        method: 'get',
        url: `/api/alumni/detail/${id}`,
        headers: {
            'admintoken': localStorage.getItem('adminToken')
        }
    })
}

// 根据学号获取校友详情
export function getAlumniByStudentId(studentId) {
    return instance.request({
        method: 'get',
        url: `/api/alumni/student/${studentId}`,
        headers: {
            'admintoken': localStorage.getItem('adminToken')
        }
    })
}

// 更新校友信息
export function updateAlumni(id, data) {
    return instance.request({
        method: 'put',
        url: `/api/alumni/update/${id}`,
        data,
        headers: {
            'admintoken': localStorage.getItem('adminToken')
        }
    })
}

// 删除校友
export function deleteAlumni(id) {
    return instance.request({
        method: 'delete',
        url: `/api/alumni/delete/${id}`,
        headers: {
            'admintoken': localStorage.getItem('adminToken')
        }
    })
}

// 批量导入校友
export function batchCreateAlumni(data) {
    return instance.request({
        method: 'post',
        url: '/api/alumni/batch-create',
        data,
        headers: {
            'admintoken': localStorage.getItem('adminToken')
        }
    })
}

// 获取统计信息
export function getAlumniStatistics() {
    return instance.request({
        method: 'get',
        url: '/api/alumni/statistics',
        headers: {
            'admintoken': localStorage.getItem('adminToken')
        }
    })
}

// 校友认证
export function verifyAlumni(data) {
    return instance.request({
        method: 'post',
        url: '/api/alumni/verify',
        data
    })
}

// 获取认证状态
export function getVerificationStatus(studentId) {
    return instance.request({
        method: 'get',
        url: `/api/alumni/verification-status/${studentId}`
    })
}